/*
 * Extended Euclid.
 * (dx - dy) * k % L = (y - x) % L
 * 求同余方程中k的最小值
 */

#include <iostream>
using namespace std;

long long mod(long long a, long long b)
{
	return (a % b + b) % b;
}
int x, y, q;	// q = gcd(a, b) = ax + by.
void extended_euclid(long long a, long long b)
{
	if(b == 0)
	{
		x = 1;
		y = 0;
		q = a;
	}
	else
	{
		extended_euclid(b, mod(a, b));
		int temp = x;
		x = y;
		y = temp - a / b * y;
	}
}

// 求同余公式最小解 (ax) % n = b % n
long long MLES(long long a, long long b, long long n)
{
	extended_euclid(a, n);
	if(mod(b, q) == 0)
	{
		return mod(x * (b / q), n / q);
	}
	else
		return -1;
}

int main()
{
	long long x, y, dx, dy, l;
	while(cin >> x >> y >> dx >> dy >> l)
	{
		long long res = MLES(dx - dy, y - x, l);

		if(res < 0)
			cout << "Impossible" << endl;
		else
			cout << res << endl;
	}

	return 0;
}
